package com.hyz.advice;

import com.hyz.model.ResponseResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.io.IOException;

/**
 * @author hegd0
 * @date 2023/4/13 11:24
 */
@RestControllerAdvice
public class ExceptionAdvice {
    @ExceptionHandler(RuntimeException.class)
    public ResponseResult<String> doException(RuntimeException e) {
        return new ResponseResult<>(-1, e.getMessage(), null);
    }

}
